name: C/C++ CI

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Clone submodules
      run: git submodule init && git submodule update --init --recursive
    - name: Prepare environment
      run: sudo bash setup.sh -b && sudo apt-get install zip
    - name: Compile system
      run: make all
    - name: Upload target
      uses: actions/upload-artifact@v3.1.0
      with:
        name: targets.zip
        path: ./targets.zip
